package JavaDesign.report_5.t_1;

/**
 * @author zouran
 * createDate：2023/10/24  22:47
 */
public class SparrowDecoratorOne extends Decorator {
    public final int DISTANCE = 50;        //eleFly方法能飞50米

    SparrowDecoratorOne(Bird bird) {  //(sparrow)
        super(bird); //(sparrow)
    }

    public int fly() {
        int distance = 0;
        distance = bird.fly() + eleFly(); // (sparrow)
        return distance;
    }

    private int eleFly() {              //装饰者新添加的方法
        return DISTANCE;
    }
}